;
; ------------------------------------------------------------
;
;   PureBasic - Module example file
;
;    (c) 2003 - Fantaisie Software
;
; ------------------------------------------------------------
;


If InitSound() = 0
  MessageRequester("Error", "DirectX 7 not available.") : End
EndIf

If InitModule() = 0
  MessageRequester("Error", "MIDAS11.dll not available.") : End
EndIf

FileName$ = OpenFileRequester("","","Modules (*.mod, *.xm, *.it)|*.mod;*.xm", 0)
If FileName$
  If LoadModule(0, FileName$)
    PlayModule(0)    
    MessageRequester("PureBasic - Module player", "Playing the module...")
    
    ; Now, perform a nice fading...
    ;
    For k=100 To 0 Step -1
      Delay(20)
      ModuleVolume(0, k)
    Next
    
  Else
    MessageRequester("Error", "Can't load the module or bad module format.")
  EndIf
EndIf

End
; IDE Options = PureBasic v4.02 (Windows - x86)
; CursorPosition = 25
; Folding = -